package rabbitmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 主题交换机的消费者
 */
@Slf4j
@Component
public class TopicConsumer {

    @RabbitListener(queues = "topic_sms_queue")
    public void smsTopicConsumer(String sms) {
        log.info(">>sms主题消费者MSG:{}", sms);
    }

    @RabbitListener(queues = "topic_sms_big_queue")
    public void smsTopicBigConsumer(String sms) {
        log.info(">>sms大主题消费者MSG:{}", sms);
    }

    @RabbitListener(queues = "topic_email_queue")
    public void emailTopicConsumer(String sms) {
        log.info(">>email主题消费者MSG:{}", sms);
    }

    @RabbitListener(queues = "topic_email_big_queue")
    public void emailTopicBigConsumer(String sms) {
        log.info(">>email大主题消费者MSG:{}", sms);
    }
}
